package android.framework.sample;

import roboguice.activity.RoboActivity;
import roboguice.inject.InjectView;
import sshason.android.framework.R;
import android.framework.paging.ConcretePagerAdapter;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.view.Menu;

public class MainActivity extends RoboActivity  {
	
	@InjectView(R.id.viewPager)
	ViewPager viewPager;
	
	private ConcretePagerAdapter pagerAdapter;
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        pagerAdapter = new ConcretePagerAdapter();
        viewPager.setAdapter(pagerAdapter);
        
        Page1 page1 = new Page1(this, R.layout.tab_layout);
        page1.setViewModel(new Page1ViewModel());
        
        Page2 page2 = new Page2(this,  R.layout.tab_layout);
        page2.setViewModel(new Page2ViewModel());
        
        pagerAdapter.addViewInitializer(page1);
        pagerAdapter.addViewInitializer(page2);
    }

	
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
}
